<?
function ldapListMachines($conn) {
	echo "<table cellspacing=\"0\" style=\"width: 600px\">";

		$info = getLdapComputers($conn);
		$count = count($info);

		echo "<tr><td colspan=4 class=\"tbhead\">".$count." Maskinkonton</td></tr>\n";
		for ($i=0; $i<$count; $i++) {
			echo '<tr><td>'."\n";
			echo '<td '.help('list_computer_show').'>';
			echo $info[$i]["cn"][0]."\n";
			echo '</td><td style="font-style: italic;" '.help('list_computer_show').'>'."\n";
			echo utf8_decode($info[$i]["displayname"][0])."\n";
			echo "</td><td style='width: 8px' ".help('list_computer_del').">\n";
			echo "  <a href=?s=sambadomain&t=machine&del=user&name=".$info[$i]["cn"][0]."&do=1 ".confirm('del_user')."><img src=/images/delete.png border=0></a>\n";
			echo "</td></tr>\n";
		}
		echo "</table><br>\n";

	echo "<br>\n";
	
	function docs() {
		require("../services/ldap/doc/ldap.php");
		docList();	
	}
};


//////////////////////////////////////////
//////////////////////////////////////////

	$conn = ldapConnect();

	html_start( array(array( 'machine', 'Maskinkonton')) );
	ldapListMachines($conn);
	html_end(false, false, false);
	ldap_close($conn);
?>
